var Active = require('../handlers/activeHandler.js')

module.exports = {

  //  获取所有actives数据
  getActiveList: function(req, res) {

    Active.find(req.query, function(err, actives) {
      if (err) {
        console.log('activeController getActiveList fail. err = ' + err)
        return res.json({
          code: 177,
          msg: err
        })
      }
      if (!actives.length) {
        return res.json({
          code: 112,
          msg: '没有数据'
        })
      }
      return res.json({
        code: 100,
        msg: '获取成功',
        data: {
          list: actives
        }
      })
    })
  }

}